package com.lhf.springcloud.rule;

import com.netflix.loadbalancer.ILoadBalancer;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RoundRobinRule;
import com.netflix.loadbalancer.Server;

public class RoundRibbonRuleImpl implements IRule {
    private ILoadBalancer lb;
    private RoundRobinRule roundRobinRule = new RoundRobinRule();
    @Override
    public Server choose(Object key) {
        System.out.println("xxxxxxxxxxx");
        return roundRobinRule.choose(key);
    }

    @Override
    public void setLoadBalancer(ILoadBalancer lb) {
        this.lb = lb;
    }
    @Override
    public ILoadBalancer getLoadBalancer() {
        return lb;
    }
}
